<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../../../common/taglib.jsp"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>审核管理</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<link href="${ctx }/css/style.css" type="text/css" rel="stylesheet" />
		<script type="text/javascript" src="${ctx }/js/jquery/jquery-1.6.1.min.js"></script>
		<script type="text/javascript">
			$(function() {
				$("#btnSelectAllUser").click(function() {
					$("input[name=userids]").each(function() {
						 $(this).attr("checked", !this.checked);              
					});
				});

				$("#btnUserpass").click(function() {
					var size = $("input[name=userids]:checked").size();

					if (size == 0) {
						alert("请选择要操作的用户！");
						return;
					}

					$("#form1").submit();
				});

				$("#btnSelectAllPost").click(function() {
					$("input[name=postids]").each(function() {
						 $(this).attr("checked", !this.checked);              
					});
				});

				$("#btnPassPost").click(function() {
					var size = $("input[name=postids]:checked").size();

					if (size == 0) {
						alert("请选择要审核通过的汇款记录！");
						return;
					}

					$("#form2").submit();
				});

				$("#btnRefusePost").click(function() {
					var size = $("input[name=postids]:checked").size();

					if (size == 0) {
						alert("请选择要退回的汇款记录！");
						return;
					}

					if (confirm('确认退回所选汇款记录么？')) {
						var form = $("#form2");
						form.attr("action", "${ctx}/admin/refusePostHistoryInfo.action");
						form.submit();

						form.attr("action", "${ctx}/admin/passPostHistoryInfo.action");
					}
				});
			});

			viewUserDetail = function(id) {
				window.showModalDialog("${ctx}/user/viewUserDetail.action?id=" + id,"","status=no;dialogWidth=380px;dialogHeight=450px;menu=no;resizeable=yes;scroll=yes;center=yes;edge=raise");
			}

			viewPostDetail = function(id) {
				window.showModalDialog("${ctx}/post/viewPostHistoryDetail.action?historyId=" + id,"","status=no;dialogWidth=380px;dialogHeight=450px;menu=no;resizeable=yes;scroll=yes;center=yes;edge=raise");
			}
		</script>
	</head>
	<body>
		  
     
   <div>
   <div style="width:480px;height:30px; text-align:left;">当前位置：审核管理</div>
<div style="width:100%;background-color:#EDDEA0; height:25px; border:1px solid gray; text-align:center;"> <b>
    待 &nbsp; &nbsp; 审 &nbsp; &nbsp; 核 &nbsp;&nbsp; &nbsp;用 &nbsp; &nbsp; 户</b></div>

<div style="width:100%;background-color:#EDDEA0; height:25px; border:1px solid gray; text-align:center;">
<div style ="float:left;width:10%; padding-top:3px"><input type="button" id="btnSelectAllUser" value="全选" style="height:20px; width:37px; cursor: hand;" /></div>
<div style ="float:left;width:33%; padding-top:3px;"></div>
<div style ="float:left;width:55%; text-align:left;">&nbsp;&nbsp; &nbsp;<img alt="" border="0" src="${ctx }/images/user.gif"  style="text-align:justify; border:0" />&nbsp;<input type="button" id="btnUserpass" style="cursor:hand; width: 90px; height: 20px;" value="用户通过审核" /></div>

</div>


<div style="width:100%;background-color:#FBF7E6; text-align:center;">
<div>
	<s:form id="form1" action="approveUserInfo" method="post" namespace="/admin">
		<table id="userTab" cellspacing="2" cellpadding="3" border="1" style="background-color:#FFF7E7;border-color:#DEBA84;border-width:1px;border-style:None;width:99%;">
			<thead>
				<tr style="color:White;background-color:#A55129;font-weight:bold; font-size: 11px;">
					<th>选定（√）</th>
					<th>用户ID</th>
					<th>用户名</th>
					<th>密码</th>
					<th>用户详情</th>
				</tr>
			</thead>
			<tbody>
				<s:if test="approveUsers.size() == 0">
					<tr style="color:#000066;background-color:#FFF7E7; font-size: 13px; text-align: center;">
						<td colspan="5">
							暂无待审核用户信息！
						</td>
					</tr>
				</s:if>
				<s:else>
					<s:iterator value="approveUsers">
						<tr style="color:#000066;background-color:#FFF7E7; font-size: 13px; text-align: center;">
							<td>
								<input type="checkbox" name="userids" value='<s:property value="id" />' />
							</td>
							<td>
								<s:property value="id" />
							</td>
							<td>
								<s:property value="username" />
							</td>
							<td>
								<s:property value="password" />
							</td>
							<td>
								<span style="color:blue;">
									<a href="#" onclick="viewUserDetail('<s:property value="id" />');">查看详细</a>
								</span>
							</td>
						</tr>
					</s:iterator>
				</s:else>
			</tbody>
		</table>	
	</s:form>
</div>
</div>  

 </div>
 <div>
 <div style="width:100%;background-color:#EDDEA0; height:25px; border:1px solid gray; text-align:center;"> <b>会 员 汇 款 审 核</b></div>

<div style="width:100%;background-color:#EDDEA0; height:25px; border:1px solid gray; text-align:center;" id="DIV1">
<div style ="float:left;width:12%; padding-top:3px"><input id="btnSelectAllPost" type="button" value="全选" style="height:20px; width:37px; cursor: hand;" /></div>
<div style="float:left;width:31%; padding-top:3px;"></div>
<div style="float:left;width:56%; text-align:center;"><img alt=""  src="${ctx }/images/savemoney.gif"  style="text-align:justify;border:0; height: 22px;"/>&nbsp;<input type="button" id="btnPassPost" style="cursor:hand" value="汇款通过审核" />
<input type="button" id="btnRefusePost" style="cursor:hand; width: 72px;" value="撤回汇款" />
</div>

</div>
<div style="width:100%;background-color:#FBF7E6; text-align:center;">
<div>
	<s:form id="form2" action="passPostHistoryInfo" method="post" namespace="/admin">
		<table cellspacing="2" cellpadding="3" border="1" style="background-color:#FFF7E7;border-color:#DEBA84;border-width:1px;border-style:None;width:99%;">
			<thead>
				<tr style="color:White;background-color:#A55129;font-weight:bold; font-size: 11px;">
					<th>选定（√）</th>
					<th>用户名</th>
					<th>金额(元)</th>
					<th>汇款时间</th>
					<th>审核状态</th>
					<th>汇款详情</th>
				</tr>
			</thead>
			<tbody>
				<s:if test="approvePostHistories.size() == 0">
					<tr style="color:#000066;background-color:#FFF7E7; font-size: 13px; text-align: center;">
						<td colspan="6">暂无待审核汇款记录！</td>
					</tr>
				</s:if>
				<s:else>
					<s:iterator value="approvePostHistories">
						<tr style="color:#000066;background-color:#FFF7E7; font-size: 13px; text-align: center;">
							<td>
								<input type="checkbox" name="postids" value='<s:property value="id" />' />
							</td>
							<td>
								<s:property value="username" />
							</td>
							<td>
								<s:property value="money" />
							</td>
							<td>
								<s:property value="%{@com.gamecard.util.DateUtil@formatDate(postTime, 'yyyy-MM-dd HH:mm:ss')}" />
							</td>
							<td>
								<s:property value="%{@com.gamecard.util.DisplayUtil@formatPostState(approveState)}" />
							</td>
							<td>
								<span style="color:blue;">
									<a href="#" onclick="viewPostDetail('<s:property value="id" />');">查看详细</a>
								</span>
							</td>
						</tr>
					</s:iterator>
				</s:else>
			</tbody>
		</table>	
	</s:form>
</div>
</div>  
 </div>
	</body>
</html>
